{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Requirement already satisfied: pandas in c:\\users\\hp\\anaconda3\\lib\\site-packages (0.24.2)\n",
      "Requirement already satisfied: pytz>=2011k in c:\\users\\hp\\anaconda3\\lib\\site-packages (from pandas) (2019.1)\n",
      "Requirement already satisfied: python-dateutil>=2.5.0 in c:\\users\\hp\\anaconda3\\lib\\site-packages (from pandas) (2.8.0)\n",
      "Requirement already satisfied: numpy>=1.12.0 in c:\\users\\hp\\anaconda3\\lib\\site-packages (from pandas) (1.16.4)\n",
      "Requirement already satisfied: six>=1.5 in c:\\users\\hp\\anaconda3\\lib\\site-packages (from python-dateutil>=2.5.0->pandas) (1.12.0)\n",
      "Collecting pyecharts\n",
      "  Downloading https://files.pythonhosted.org/packages/f1/f4/66f4340de85545340f54c230352419d21dfa55f01fa00aec137b283ce95c/pyecharts-1.9.1-py3-none-any.whl (135kB)\n",
      "Collecting prettytable (from pyecharts)\n",
      "  Downloading https://files.pythonhosted.org/packages/96/53/91638391af5a68d27402b920ccc3fdfae51dd3e333476b414393d4478a70/prettytable-3.2.0-py3-none-any.whl\n",
      "Collecting simplejson (from pyecharts)\n",
      "  Downloading https://files.pythonhosted.org/packages/3f/57/90ffb53ee34a1c4925092dd12ebbda8bba921b29f6c625bb7dcd5df08246/simplejson-3.17.6-cp37-cp37m-win_amd64.whl (75kB)\n",
      "Requirement already satisfied: jinja2 in c:\\users\\hp\\anaconda3\\lib\\site-packages (from pyecharts) (2.10.1)\n",
      "Requirement already satisfied: wcwidth in c:\\users\\hp\\anaconda3\\lib\\site-packages (from prettytable->pyecharts) (0.1.7)\n",
      "Requirement already satisfied: importlib-metadata; python_version < \"3.8\" in c:\\users\\hp\\anaconda3\\lib\\site-packages (from prettytable->pyecharts) (0.17)\n",
      "Requirement already satisfied: MarkupSafe>=0.23 in c:\\users\\hp\\anaconda3\\lib\\site-packages (from jinja2->pyecharts) (1.1.1)\n",
      "Requirement already satisfied: zipp>=0.5 in c:\\users\\hp\\anaconda3\\lib\\site-packages (from importlib-metadata; python_version < \"3.8\"->prettytable->pyecharts) (0.5.1)\n",
      "Installing collected packages: prettytable, simplejson, pyecharts\n",
      "Successfully installed prettytable-3.2.0 pyecharts-1.9.1 simplejson-3.17.6\n"
     ]
    }
   ],
   "source": [
    "!pip install pandas \n",
    "!pip install pyecharts\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"1a300e5bc2864f90be4abb3408ceedac\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_1a300e5bc2864f90be4abb3408ceedac = echarts.init(\n",
       "                    document.getElementById('1a300e5bc2864f90be4abb3408ceedac'), 'white', {renderer: 'canvas'});\n",
       "                var option_1a300e5bc2864f90be4abb3408ceedac = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5e7f\\u897f\\u589e\\u957f\\u7387\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                22.69729634062063,\n",
       "                20.565098456059253,\n",
       "                10.513602050989885,\n",
       "                23.336160099804626,\n",
       "                22.477050319492996,\n",
       "                11.212734208296819,\n",
       "                10.853771739380589,\n",
       "                8.463657187939015,\n",
       "                7.211369441117749,\n",
       "                9.013326096582066\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5e7f\\u897fGDP\",\n",
       "            \"connectNulls\": false,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"2007y\",\n",
       "                    5823.41\n",
       "                ],\n",
       "                [\n",
       "                    \"2008y\",\n",
       "                    7021.0\n",
       "                ],\n",
       "                [\n",
       "                    \"2009y\",\n",
       "                    7759.16\n",
       "                ],\n",
       "                [\n",
       "                    \"2010y\",\n",
       "                    9569.85\n",
       "                ],\n",
       "                [\n",
       "                    \"2011y\",\n",
       "                    11720.87\n",
       "                ],\n",
       "                [\n",
       "                    \"2012y\",\n",
       "                    13035.1\n",
       "                ],\n",
       "                [\n",
       "                    \"2013y\",\n",
       "                    14449.9\n",
       "                ],\n",
       "                [\n",
       "                    \"2014y\",\n",
       "                    15672.89\n",
       "                ],\n",
       "                [\n",
       "                    \"2015y\",\n",
       "                    16803.12\n",
       "                ],\n",
       "                [\n",
       "                    \"2016y\",\n",
       "                    18317.64\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5e7f\\u897f\\u589e\\u957f\\u7387\",\n",
       "                \"\\u5e7f\\u897fGDP\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5e7f\\u897f\\u589e\\u957f\\u7387\": true,\n",
       "                \"\\u5e7f\\u897fGDP\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"2007y\",\n",
       "                \"2008y\",\n",
       "                \"2009y\",\n",
       "                \"2010y\",\n",
       "                \"2011y\",\n",
       "                \"2012y\",\n",
       "                \"2013y\",\n",
       "                \"2014y\",\n",
       "                \"2015y\",\n",
       "                \"2016y\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisLabel\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{value} %\"\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"max\": 100,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_1a300e5bc2864f90be4abb3408ceedac.setOption(option_1a300e5bc2864f90be4abb3408ceedac);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x213c62c1da0>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#读取gdp.csv数据，画出广西，近10年的每年GDP总量和增速数据叠图。总量用线图，增量用柱状图。\n",
    "#其中增长率用百分比，对应Y轴最大值为100%\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Line, Page, Scatter\n",
    "from pyecharts.faker import Collector, Faker\n",
    "from pyecharts.globals import CurrentConfig\n",
    "\n",
    "import pandas as pd\n",
    "\n",
    "def get_province_gdp(df, iindex):\n",
    "    province = df.iloc[iindex].sort_index()[-1]\n",
    "    gdps = df.iloc[iindex].sort_index()[-12:-1]\n",
    "    incr =(df.iloc[iindex].sort_index()[-12:-1] - df.iloc[iindex].sort_index()[-12:-1].shift())/\\\n",
    "          df.iloc[iindex].sort_index()[-12:-1].shift() *100\n",
    "    return province, gdps[1:] , incr[1:]\n",
    "\n",
    "df = pd.read_csv(r\"D:/数据可视化/实验/gdp.csv\")\n",
    "province, gdps, incr = get_province_gdp(df, 19)\n",
    "\n",
    "def bar_first():\n",
    "    bar = Bar()\n",
    "    bar.add_xaxis(eval(repr(gdps.index.tolist())))\n",
    "    bar.add_yaxis(province + \"增长率\", eval(repr(incr.values.tolist())))\n",
    "    bar.set_global_opts(\n",
    "        yaxis_opts=opts.AxisOpts(\n",
    "            max_= 100,\n",
    "            axislabel_opts=opts.LabelOpts(formatter=\"{value} %\")\n",
    "\n",
    "        ))\n",
    "    bar.set_series_opts(label_opts=opts.LabelOpts(is_show=False))\n",
    "    bar.extend_axis(yaxis=opts.AxisOpts())\n",
    "    return bar\n",
    "\n",
    "def line_second():\n",
    "    line = Line().add_xaxis(eval(repr(gdps.index.tolist())))\\\n",
    "    .add_yaxis( \"广西GDP\",  eval(repr(gdps.values.tolist())), yaxis_index=1)\n",
    "    return line\n",
    "bar_first().overlap(line_second()).render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"e050de53750b442ebd890eea402522d5\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_e050de53750b442ebd890eea402522d5 = echarts.init(\n",
       "                    document.getElementById('e050de53750b442ebd890eea402522d5'), 'white', {renderer: 'canvas'});\n",
       "                var option_e050de53750b442ebd890eea402522d5 = {\n",
       "    \"baseOption\": {\n",
       "        \"series\": [\n",
       "            {\n",
       "                \"type\": \"line\",\n",
       "                \"name\": \"\\u5e7f\\u897f\",\n",
       "                \"connectNulls\": false,\n",
       "                \"symbolSize\": 4,\n",
       "                \"showSymbol\": true,\n",
       "                \"smooth\": false,\n",
       "                \"clip\": true,\n",
       "                \"step\": false,\n",
       "                \"data\": [\n",
       "                    [\n",
       "                        \"2007y\",\n",
       "                        5823.41\n",
       "                    ],\n",
       "                    [\n",
       "                        \"2008y\",\n",
       "                        7021.0\n",
       "                    ],\n",
       "                    [\n",
       "                        \"2009y\",\n",
       "                        7759.16\n",
       "                    ],\n",
       "                    [\n",
       "                        \"2010y\",\n",
       "                        9569.85\n",
       "                    ],\n",
       "                    [\n",
       "                        \"2011y\",\n",
       "                        11720.87\n",
       "                    ],\n",
       "                    [\n",
       "                        \"2012y\",\n",
       "                        13035.1\n",
       "                    ],\n",
       "                    [\n",
       "                        \"2013y\",\n",
       "                        14449.9\n",
       "                    ],\n",
       "                    [\n",
       "                        \"2014y\",\n",
       "                        15672.89\n",
       "                    ],\n",
       "                    [\n",
       "                        \"2015y\",\n",
       "                        16803.12\n",
       "                    ],\n",
       "                    [\n",
       "                        \"2016y\",\n",
       "                        18317.64\n",
       "                    ]\n",
       "                ],\n",
       "                \"hoverAnimation\": true,\n",
       "                \"label\": {\n",
       "                    \"show\": true,\n",
       "                    \"position\": \"top\",\n",
       "                    \"margin\": 8\n",
       "                },\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                },\n",
       "                \"areaStyle\": {\n",
       "                    \"opacity\": 0\n",
       "                },\n",
       "                \"zlevel\": 0,\n",
       "                \"z\": 0\n",
       "            }\n",
       "        ],\n",
       "        \"timeline\": {\n",
       "            \"axisType\": \"category\",\n",
       "            \"orient\": \"horizontal\",\n",
       "            \"autoPlay\": false,\n",
       "            \"controlPosition\": \"left\",\n",
       "            \"loop\": true,\n",
       "            \"rewind\": false,\n",
       "            \"show\": true,\n",
       "            \"inverse\": false,\n",
       "            \"bottom\": \"-5px\",\n",
       "            \"data\": [\n",
       "                2011,\n",
       "                2012,\n",
       "                2013,\n",
       "                2014,\n",
       "                2015,\n",
       "                2016\n",
       "            ]\n",
       "        },\n",
       "        \"xAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": false,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": false,\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                },\n",
       "                \"data\": [\n",
       "                    \"2007y\",\n",
       "                    \"2008y\",\n",
       "                    \"2009y\",\n",
       "                    \"2010y\",\n",
       "                    \"2011y\",\n",
       "                    \"2012y\",\n",
       "                    \"2013y\",\n",
       "                    \"2014y\",\n",
       "                    \"2015y\",\n",
       "                    \"2016y\"\n",
       "                ]\n",
       "            }\n",
       "        ],\n",
       "        \"yAxis\": [\n",
       "            {\n",
       "                \"show\": true,\n",
       "                \"scale\": true,\n",
       "                \"nameLocation\": \"end\",\n",
       "                \"nameGap\": 15,\n",
       "                \"gridIndex\": 0,\n",
       "                \"inverse\": false,\n",
       "                \"offset\": 0,\n",
       "                \"splitNumber\": 5,\n",
       "                \"max\": 18317.64,\n",
       "                \"minInterval\": 0,\n",
       "                \"splitLine\": {\n",
       "                    \"show\": true,\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    }\n",
       "                }\n",
       "            }\n",
       "        ]\n",
       "    },\n",
       "    \"options\": [\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5e7f\\u897f\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5e7f\\u897f\": true\n",
       "                    },\n",
       "                    \"show\": true,\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10,\n",
       "                    \"itemWidth\": 25,\n",
       "                    \"itemHeight\": 14\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"line\",\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"connectNulls\": false,\n",
       "                    \"symbolSize\": 4,\n",
       "                    \"showSymbol\": true,\n",
       "                    \"smooth\": false,\n",
       "                    \"clip\": true,\n",
       "                    \"step\": false,\n",
       "                    \"data\": [\n",
       "                        [\n",
       "                            \"2007y\",\n",
       "                            5823.41\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2008y\",\n",
       "                            7021.0\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2009y\",\n",
       "                            7759.16\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2010y\",\n",
       "                            9569.85\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2011y\",\n",
       "                            11720.87\n",
       "                        ]\n",
       "                    ],\n",
       "                    \"hoverAnimation\": true,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"position\": \"top\",\n",
       "                        \"margin\": 8\n",
       "                    },\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    },\n",
       "                    \"areaStyle\": {\n",
       "                        \"opacity\": 0\n",
       "                    },\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 0\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"2007y\",\n",
       "                        \"2008y\",\n",
       "                        \"2009y\",\n",
       "                        \"2010y\",\n",
       "                        \"2011y\",\n",
       "                        \"2012y\",\n",
       "                        \"2013y\",\n",
       "                        \"2014y\",\n",
       "                        \"2015y\",\n",
       "                        \"2016y\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": true,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"max\": 18317.64,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Line-\\u5bf9\\u6570\\u8f74\\u793a\\u4f8b\",\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5e7f\\u897f\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5e7f\\u897f\": true\n",
       "                    },\n",
       "                    \"show\": true,\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10,\n",
       "                    \"itemWidth\": 25,\n",
       "                    \"itemHeight\": 14\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"line\",\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"connectNulls\": false,\n",
       "                    \"symbolSize\": 4,\n",
       "                    \"showSymbol\": true,\n",
       "                    \"smooth\": false,\n",
       "                    \"clip\": true,\n",
       "                    \"step\": false,\n",
       "                    \"data\": [\n",
       "                        [\n",
       "                            \"2007y\",\n",
       "                            5823.41\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2008y\",\n",
       "                            7021.0\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2009y\",\n",
       "                            7759.16\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2010y\",\n",
       "                            9569.85\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2011y\",\n",
       "                            11720.87\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2012y\",\n",
       "                            13035.1\n",
       "                        ]\n",
       "                    ],\n",
       "                    \"hoverAnimation\": true,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"position\": \"top\",\n",
       "                        \"margin\": 8\n",
       "                    },\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    },\n",
       "                    \"areaStyle\": {\n",
       "                        \"opacity\": 0\n",
       "                    },\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 0\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"2007y\",\n",
       "                        \"2008y\",\n",
       "                        \"2009y\",\n",
       "                        \"2010y\",\n",
       "                        \"2011y\",\n",
       "                        \"2012y\",\n",
       "                        \"2013y\",\n",
       "                        \"2014y\",\n",
       "                        \"2015y\",\n",
       "                        \"2016y\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": true,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"max\": 18317.64,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Line-\\u5bf9\\u6570\\u8f74\\u793a\\u4f8b\",\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5e7f\\u897f\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5e7f\\u897f\": true\n",
       "                    },\n",
       "                    \"show\": true,\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10,\n",
       "                    \"itemWidth\": 25,\n",
       "                    \"itemHeight\": 14\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"line\",\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"connectNulls\": false,\n",
       "                    \"symbolSize\": 4,\n",
       "                    \"showSymbol\": true,\n",
       "                    \"smooth\": false,\n",
       "                    \"clip\": true,\n",
       "                    \"step\": false,\n",
       "                    \"data\": [\n",
       "                        [\n",
       "                            \"2007y\",\n",
       "                            5823.41\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2008y\",\n",
       "                            7021.0\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2009y\",\n",
       "                            7759.16\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2010y\",\n",
       "                            9569.85\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2011y\",\n",
       "                            11720.87\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2012y\",\n",
       "                            13035.1\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2013y\",\n",
       "                            14449.9\n",
       "                        ]\n",
       "                    ],\n",
       "                    \"hoverAnimation\": true,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"position\": \"top\",\n",
       "                        \"margin\": 8\n",
       "                    },\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    },\n",
       "                    \"areaStyle\": {\n",
       "                        \"opacity\": 0\n",
       "                    },\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 0\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"2007y\",\n",
       "                        \"2008y\",\n",
       "                        \"2009y\",\n",
       "                        \"2010y\",\n",
       "                        \"2011y\",\n",
       "                        \"2012y\",\n",
       "                        \"2013y\",\n",
       "                        \"2014y\",\n",
       "                        \"2015y\",\n",
       "                        \"2016y\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": true,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"max\": 18317.64,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Line-\\u5bf9\\u6570\\u8f74\\u793a\\u4f8b\",\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5e7f\\u897f\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5e7f\\u897f\": true\n",
       "                    },\n",
       "                    \"show\": true,\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10,\n",
       "                    \"itemWidth\": 25,\n",
       "                    \"itemHeight\": 14\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"line\",\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"connectNulls\": false,\n",
       "                    \"symbolSize\": 4,\n",
       "                    \"showSymbol\": true,\n",
       "                    \"smooth\": false,\n",
       "                    \"clip\": true,\n",
       "                    \"step\": false,\n",
       "                    \"data\": [\n",
       "                        [\n",
       "                            \"2007y\",\n",
       "                            5823.41\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2008y\",\n",
       "                            7021.0\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2009y\",\n",
       "                            7759.16\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2010y\",\n",
       "                            9569.85\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2011y\",\n",
       "                            11720.87\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2012y\",\n",
       "                            13035.1\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2013y\",\n",
       "                            14449.9\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2014y\",\n",
       "                            15672.89\n",
       "                        ]\n",
       "                    ],\n",
       "                    \"hoverAnimation\": true,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"position\": \"top\",\n",
       "                        \"margin\": 8\n",
       "                    },\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    },\n",
       "                    \"areaStyle\": {\n",
       "                        \"opacity\": 0\n",
       "                    },\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 0\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"2007y\",\n",
       "                        \"2008y\",\n",
       "                        \"2009y\",\n",
       "                        \"2010y\",\n",
       "                        \"2011y\",\n",
       "                        \"2012y\",\n",
       "                        \"2013y\",\n",
       "                        \"2014y\",\n",
       "                        \"2015y\",\n",
       "                        \"2016y\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": true,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"max\": 18317.64,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Line-\\u5bf9\\u6570\\u8f74\\u793a\\u4f8b\",\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5e7f\\u897f\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5e7f\\u897f\": true\n",
       "                    },\n",
       "                    \"show\": true,\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10,\n",
       "                    \"itemWidth\": 25,\n",
       "                    \"itemHeight\": 14\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"line\",\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"connectNulls\": false,\n",
       "                    \"symbolSize\": 4,\n",
       "                    \"showSymbol\": true,\n",
       "                    \"smooth\": false,\n",
       "                    \"clip\": true,\n",
       "                    \"step\": false,\n",
       "                    \"data\": [\n",
       "                        [\n",
       "                            \"2007y\",\n",
       "                            5823.41\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2008y\",\n",
       "                            7021.0\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2009y\",\n",
       "                            7759.16\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2010y\",\n",
       "                            9569.85\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2011y\",\n",
       "                            11720.87\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2012y\",\n",
       "                            13035.1\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2013y\",\n",
       "                            14449.9\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2014y\",\n",
       "                            15672.89\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2015y\",\n",
       "                            16803.12\n",
       "                        ]\n",
       "                    ],\n",
       "                    \"hoverAnimation\": true,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"position\": \"top\",\n",
       "                        \"margin\": 8\n",
       "                    },\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    },\n",
       "                    \"areaStyle\": {\n",
       "                        \"opacity\": 0\n",
       "                    },\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 0\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"2007y\",\n",
       "                        \"2008y\",\n",
       "                        \"2009y\",\n",
       "                        \"2010y\",\n",
       "                        \"2011y\",\n",
       "                        \"2012y\",\n",
       "                        \"2013y\",\n",
       "                        \"2014y\",\n",
       "                        \"2015y\",\n",
       "                        \"2016y\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": true,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"max\": 18317.64,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Line-\\u5bf9\\u6570\\u8f74\\u793a\\u4f8b\",\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"legend\": [\n",
       "                {\n",
       "                    \"data\": [\n",
       "                        \"\\u5e7f\\u897f\"\n",
       "                    ],\n",
       "                    \"selected\": {\n",
       "                        \"\\u5e7f\\u897f\": true\n",
       "                    },\n",
       "                    \"show\": true,\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10,\n",
       "                    \"itemWidth\": 25,\n",
       "                    \"itemHeight\": 14\n",
       "                }\n",
       "            ],\n",
       "            \"series\": [\n",
       "                {\n",
       "                    \"type\": \"line\",\n",
       "                    \"name\": \"\\u5e7f\\u897f\",\n",
       "                    \"connectNulls\": false,\n",
       "                    \"symbolSize\": 4,\n",
       "                    \"showSymbol\": true,\n",
       "                    \"smooth\": false,\n",
       "                    \"clip\": true,\n",
       "                    \"step\": false,\n",
       "                    \"data\": [\n",
       "                        [\n",
       "                            \"2007y\",\n",
       "                            5823.41\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2008y\",\n",
       "                            7021.0\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2009y\",\n",
       "                            7759.16\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2010y\",\n",
       "                            9569.85\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2011y\",\n",
       "                            11720.87\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2012y\",\n",
       "                            13035.1\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2013y\",\n",
       "                            14449.9\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2014y\",\n",
       "                            15672.89\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2015y\",\n",
       "                            16803.12\n",
       "                        ],\n",
       "                        [\n",
       "                            \"2016y\",\n",
       "                            18317.64\n",
       "                        ]\n",
       "                    ],\n",
       "                    \"hoverAnimation\": true,\n",
       "                    \"label\": {\n",
       "                        \"show\": true,\n",
       "                        \"position\": \"top\",\n",
       "                        \"margin\": 8\n",
       "                    },\n",
       "                    \"lineStyle\": {\n",
       "                        \"show\": true,\n",
       "                        \"width\": 1,\n",
       "                        \"opacity\": 1,\n",
       "                        \"curveness\": 0,\n",
       "                        \"type\": \"solid\"\n",
       "                    },\n",
       "                    \"areaStyle\": {\n",
       "                        \"opacity\": 0\n",
       "                    },\n",
       "                    \"zlevel\": 0,\n",
       "                    \"z\": 0\n",
       "                }\n",
       "            ],\n",
       "            \"xAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": false,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": false,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    },\n",
       "                    \"data\": [\n",
       "                        \"2007y\",\n",
       "                        \"2008y\",\n",
       "                        \"2009y\",\n",
       "                        \"2010y\",\n",
       "                        \"2011y\",\n",
       "                        \"2012y\",\n",
       "                        \"2013y\",\n",
       "                        \"2014y\",\n",
       "                        \"2015y\",\n",
       "                        \"2016y\"\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"yAxis\": [\n",
       "                {\n",
       "                    \"show\": true,\n",
       "                    \"scale\": true,\n",
       "                    \"nameLocation\": \"end\",\n",
       "                    \"nameGap\": 15,\n",
       "                    \"gridIndex\": 0,\n",
       "                    \"inverse\": false,\n",
       "                    \"offset\": 0,\n",
       "                    \"splitNumber\": 5,\n",
       "                    \"max\": 18317.64,\n",
       "                    \"minInterval\": 0,\n",
       "                    \"splitLine\": {\n",
       "                        \"show\": true,\n",
       "                        \"lineStyle\": {\n",
       "                            \"show\": true,\n",
       "                            \"width\": 1,\n",
       "                            \"opacity\": 1,\n",
       "                            \"curveness\": 0,\n",
       "                            \"type\": \"solid\"\n",
       "                        }\n",
       "                    }\n",
       "                }\n",
       "            ],\n",
       "            \"title\": [\n",
       "                {\n",
       "                    \"text\": \"Line-\\u5bf9\\u6570\\u8f74\\u793a\\u4f8b\",\n",
       "                    \"padding\": 5,\n",
       "                    \"itemGap\": 10\n",
       "                }\n",
       "            ],\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"color\": [\n",
       "                \"#c23531\",\n",
       "                \"#2f4554\",\n",
       "                \"#61a0a8\",\n",
       "                \"#d48265\",\n",
       "                \"#749f83\",\n",
       "                \"#ca8622\",\n",
       "                \"#bda29a\",\n",
       "                \"#6e7074\",\n",
       "                \"#546570\",\n",
       "                \"#c4ccd3\",\n",
       "                \"#f05b72\",\n",
       "                \"#ef5b9c\",\n",
       "                \"#f47920\",\n",
       "                \"#905a3d\",\n",
       "                \"#fab27b\",\n",
       "                \"#2a5caa\",\n",
       "                \"#444693\",\n",
       "                \"#726930\",\n",
       "                \"#b2d235\",\n",
       "                \"#6d8346\",\n",
       "                \"#ac6767\",\n",
       "                \"#1d953f\",\n",
       "                \"#6950a1\",\n",
       "                \"#918597\"\n",
       "            ]\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_e050de53750b442ebd890eea402522d5.setOption(option_e050de53750b442ebd890eea402522d5);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x213c754c4a8>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#读取gdp.csv数据，画出广西，近10年的每年GDP总量线图的时间线。折线开始只有2007~2011的五年数据，每年延伸一个数据。\n",
    "#开启自动播放、循环效果\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, BMap, Grid, Map,Line, Page, Pie, Sankey, Timeline\n",
    "from pyecharts.faker import Collector, Faker\n",
    "\n",
    "import pandas as pd\n",
    "\n",
    "\n",
    "def get_province_gdp(df, iindex):\n",
    "    province = df.iloc[iindex].sort_index()[-1]\n",
    "    gdps = df.iloc[iindex].sort_index()[-12:-1]\n",
    "    incr =(df.iloc[iindex].sort_index()[-12:-1] - df.iloc[iindex].sort_index()[-12:-1].shift())/\\\n",
    "          df.iloc[iindex].sort_index()[-12:-1].shift() *100\n",
    "    return province, gdps[1:] , incr[1:]\n",
    "\n",
    "df = pd.read_csv(r\"D:/数据可视化/实验/gdp.csv\")\n",
    "province, gdps, incr = get_province_gdp(df, 19)\n",
    "\n",
    "def timeline_with_multi_axis2() -> Timeline:\n",
    "    tl = Timeline()\n",
    "   # tl.add_schema(axis_type='category')\n",
    "    for i in range(4, len(gdps) ):\n",
    "        year = gdps.index.tolist()[i]\n",
    "        line = (\n",
    "            Line()\n",
    "            .add_xaxis(xaxis_data=eval(repr( gdps.index.tolist()  )))\n",
    "            .add_yaxis( province,\n",
    "                        y_axis=eval(repr( gdps.loc[:year].values.tolist()  )))\n",
    "            .set_global_opts(\n",
    "                title_opts=opts.TitleOpts(title=\"Line-对数轴示例\"),\n",
    "                yaxis_opts=opts.AxisOpts(\n",
    "                   max_= gdps.max(),\n",
    "                    splitline_opts=opts.SplitLineOpts(is_show=True),\n",
    "                    is_scale=True,\n",
    "                )\n",
    "            )\n",
    "        )\n",
    "        tl.add(line, int(year[:-1]))\n",
    "    return tl\n",
    "timeline_with_multi_axis2().render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"3a29ad80e35648dbabeed77846ca21bb\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_3a29ad80e35648dbabeed77846ca21bb = echarts.init(\n",
       "                    document.getElementById('3a29ad80e35648dbabeed77846ca21bb'), 'white', {renderer: 'canvas'});\n",
       "                var option_3a29ad80e35648dbabeed77846ca21bb = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                118,\n",
       "                23,\n",
       "                79,\n",
       "                65,\n",
       "                31,\n",
       "                55,\n",
       "                122\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0,\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                74,\n",
       "                25,\n",
       "                65,\n",
       "                44,\n",
       "                44,\n",
       "                24,\n",
       "                98\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u53ef\\u4e50\",\n",
       "                    131\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u96ea\\u78a7\",\n",
       "                    74\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6a59\\u6c41\",\n",
       "                    78\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7eff\\u8336\",\n",
       "                    105\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5976\\u8336\",\n",
       "                    75\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u767e\\u5a01\",\n",
       "                    106\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9752\\u5c9b\",\n",
       "                    87\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u53ef\\u4e50\",\n",
       "                    103\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u96ea\\u78a7\",\n",
       "                    99\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6a59\\u6c41\",\n",
       "                    104\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7eff\\u8336\",\n",
       "                    20\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5976\\u8336\",\n",
       "                    69\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u767e\\u5a01\",\n",
       "                    112\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u9752\\u5c9b\",\n",
       "                    52\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"xAxisIndex\": 2,\n",
       "            \"yAxisIndex\": 2,\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                66,\n",
       "                150,\n",
       "                101,\n",
       "                105,\n",
       "                42,\n",
       "                102,\n",
       "                112\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"xAxisIndex\": 2,\n",
       "            \"yAxisIndex\": 2,\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                123,\n",
       "                103,\n",
       "                117,\n",
       "                148,\n",
       "                143,\n",
       "                136,\n",
       "                38\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6A\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 3,\n",
       "            \"yAxisIndex\": 3,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u54c8\\u58eb\\u5947\",\n",
       "                    91\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8428\\u6469\\u8036\",\n",
       "                    77\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6cf0\\u8fea\",\n",
       "                    149\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u91d1\\u6bdb\",\n",
       "                    52\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7267\\u7f8a\\u72ac\",\n",
       "                    127\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5409\\u5a03\\u5a03\",\n",
       "                    104\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u67ef\\u57fa\",\n",
       "                    40\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"line\",\n",
       "            \"name\": \"\\u5546\\u5bb6B\",\n",
       "            \"connectNulls\": false,\n",
       "            \"xAxisIndex\": 3,\n",
       "            \"yAxisIndex\": 3,\n",
       "            \"symbolSize\": 4,\n",
       "            \"showSymbol\": true,\n",
       "            \"smooth\": false,\n",
       "            \"clip\": true,\n",
       "            \"step\": false,\n",
       "            \"data\": [\n",
       "                [\n",
       "                    \"\\u54c8\\u58eb\\u5947\",\n",
       "                    33\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u8428\\u6469\\u8036\",\n",
       "                    53\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u6cf0\\u8fea\",\n",
       "                    103\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u91d1\\u6bdb\",\n",
       "                    67\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u7267\\u7f8a\\u72ac\",\n",
       "                    146\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u5409\\u5a03\\u5a03\",\n",
       "                    81\n",
       "                ],\n",
       "                [\n",
       "                    \"\\u67ef\\u57fa\",\n",
       "                    35\n",
       "                ]\n",
       "            ],\n",
       "            \"hoverAnimation\": true,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"lineStyle\": {\n",
       "                \"show\": true,\n",
       "                \"width\": 1,\n",
       "                \"opacity\": 1,\n",
       "                \"curveness\": 0,\n",
       "                \"type\": \"solid\"\n",
       "            },\n",
       "            \"areaStyle\": {\n",
       "                \"opacity\": 0\n",
       "            },\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 0\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"top\": \"48%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        },\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5546\\u5bb6A\",\n",
       "                \"\\u5546\\u5bb6B\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u5546\\u5bb6A\": true,\n",
       "                \"\\u5546\\u5bb6B\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"top\": \"48%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u886c\\u886b\",\n",
       "                \"\\u6bdb\\u8863\",\n",
       "                \"\\u9886\\u5e26\",\n",
       "                \"\\u88e4\\u5b50\",\n",
       "                \"\\u98ce\\u8863\",\n",
       "                \"\\u9ad8\\u8ddf\\u978b\",\n",
       "                \"\\u889c\\u5b50\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u53ef\\u4e50\",\n",
       "                \"\\u96ea\\u78a7\",\n",
       "                \"\\u6a59\\u6c41\",\n",
       "                \"\\u7eff\\u8336\",\n",
       "                \"\\u5976\\u8336\",\n",
       "                \"\\u767e\\u5a01\",\n",
       "                \"\\u9752\\u5c9b\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 2,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u8349\\u8393\",\n",
       "                \"\\u8292\\u679c\",\n",
       "                \"\\u8461\\u8404\",\n",
       "                \"\\u96ea\\u68a8\",\n",
       "                \"\\u897f\\u74dc\",\n",
       "                \"\\u67e0\\u6aac\",\n",
       "                \"\\u8f66\\u5398\\u5b50\"\n",
       "            ]\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 3,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"\\u54c8\\u58eb\\u5947\",\n",
       "                \"\\u8428\\u6469\\u8036\",\n",
       "                \"\\u6cf0\\u8fea\",\n",
       "                \"\\u91d1\\u6bdb\",\n",
       "                \"\\u7267\\u7f8a\\u72ac\",\n",
       "                \"\\u5409\\u5a03\\u5a03\",\n",
       "                \"\\u67ef\\u57fa\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 1,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 2,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 3,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Grid-Bar\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"Grid-Line\",\n",
       "            \"top\": \"48%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"Grid-Bar\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        },\n",
       "        {\n",
       "            \"text\": \"Grid-Line\",\n",
       "            \"top\": \"48%\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"right\": \"60%\",\n",
       "            \"bottom\": \"60%\",\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        },\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"top\": \"60%\",\n",
       "            \"right\": \"60%\",\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        },\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"left\": \"60%\",\n",
       "            \"bottom\": \"60%\",\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        },\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"left\": \"60%\",\n",
       "            \"top\": \"60%\",\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_3a29ad80e35648dbabeed77846ca21bb.setOption(option_3a29ad80e35648dbabeed77846ca21bb);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x213c75a1b38>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#1）通过InitOpts增加grid画布大小，制作一个2*2的网格图.\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar, Grid , Line , Geo , Kline , Page , Scatter\n",
    "from pyecharts.faker import Faker , Collector\n",
    "from pyecharts.globals import ChartType , SymbolType\n",
    "def grid_vertical() -> Grid:\n",
    "    bar = (\n",
    "        Bar()\n",
    "        .add_xaxis(Faker.choose())\n",
    "        .add_yaxis(\"商家A\", Faker.values())\n",
    "        .add_yaxis(\"商家B\", Faker.values())\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"Grid-Bar\"))\n",
    ")\n",
    "    line = (\n",
    "        Line()\n",
    "        .add_xaxis(Faker.choose())\n",
    "        .add_yaxis(\"商家A\", Faker.values())\n",
    "        .add_yaxis(\"商家B\", Faker.values())\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"Grid-Line\", pos_top=\"48%\"),\n",
    "            legend_opts=opts.LegendOpts(pos_top=\"48%\"),\n",
    "    )\n",
    ")\n",
    "\n",
    "    bar2 = (\n",
    "        Bar()\n",
    "        .add_xaxis(Faker.choose())\n",
    "        .add_yaxis(\"商家A\", Faker.values())\n",
    "        .add_yaxis(\"商家B\", Faker.values())\n",
    "        .set_global_opts(title_opts=opts.TitleOpts(title=\"Grid-Bar\"))\n",
    "    )\n",
    "    line2= (\n",
    "        Line()\n",
    "        .add_xaxis(Faker.choose())\n",
    "        .add_yaxis(\"商家A\", Faker.values())\n",
    "        .add_yaxis(\"商家B\", Faker.values())\n",
    "        .set_global_opts(\n",
    "            title_opts=opts.TitleOpts(title=\"Grid-Line\", pos_top=\"48%\"),\n",
    "            legend_opts=opts.LegendOpts(pos_top=\"48%\"),\n",
    "    ))\n",
    "    grid = (\n",
    "        Grid()\n",
    "        .add(bar, grid_opts=opts.GridOpts(pos_bottom=\"60%\",pos_right=\"60%\"))\n",
    "        .add(line, grid_opts=opts.GridOpts(pos_top=\"60%\",pos_right=\"60%\"))\n",
    "        .add(bar2, grid_opts=opts.GridOpts(pos_bottom=\"60%\",pos_left=\"60%\"))\n",
    "        .add(line2, grid_opts=opts.GridOpts(pos_top=\"60%\",pos_left=\"60%\"))\n",
    "\n",
    ")\n",
    "\n",
    "    return grid\n",
    "grid_vertical().render_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
